//
// Created by 10462397 on 2021/7/22.
//

#include "../../common.h"

class Solution {
public:
    int removeElement(vector<int>& nums, int val) {
        int fast = 0, slow = 0;
        while (fast < nums.size()) {
            if (nums[fast] != val) {
                nums[slow] = nums[fast];
                ++slow;
            }
            ++fast;
        }
        return slow;
    }
};

int main() {
    vector<int> v{3,3,4};
    cout << Solution().removeElement(v, 3);
}